<%@ page import="bbs.mvc.Beans.Posting" %>
<%@ page import="bbs.mvc.Beans.DBUtils" %>
<%@ page import="java.sql.SQLException" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String id = request.getParameter("id");
    String sql;
    sql ="SELECT * FROM `blogdata` WHERE" +
            " `id` = " +"'"+ id +"'";
    Posting posting= null;
    try {
        posting = DBUtils.getPosting(sql);
    } catch (SQLException e) {
        e.printStackTrace();
    }
    String title= posting.getTiltle();
    String author= posting.getAuthor();
    String content= posting.getContent();
%>
<html>
<head>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
    <style>
        .menu {font-weight:bold; font-size:1em; padding:2em}
        tr {line-height:2.5em}
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: #000;
        }

        *, *::before, *::after {
            box-sizing: border-box;
        }

        @keyframes rotate {
            100% {
                transform: rotate(1turn);
            }
        }

        .conic {

            position: relative;
            z-index: 0;
            width: auto;
            height: auto;
            margin: 20px;
            border-radius: 10px;
            overflow: hidden;
            padding: 2rem;}

        .conic::before {
            content: '';
            position: absolute;
            z-index: -2;
            left: -50%;
            top: -50%;
            width: 200%;
            height: 200%;
            background-color: #1a232a;
            background-repeat: no-repeat;
            background-position: 0 0;
            background-image: conic-gradient(transparent, rgba(168, 239, 255, 1), transparent 30%);
            animation: rotate 4s linear infinite;
        }

        .conic::after {
            content: '';
            position: absolute;
            z-index: -1;
            left: 6px;
            top: 6px;
            width: calc(100% - 12px);
            height: calc(100% - 12px);
            background: #000;
            border-radius: 5px;
        }
        }

        .conic-demo::after {
            animation: opacityChange 5s infinite linear;
        }

        @keyframes opacityChange {
            50% {
                opacity:.5;
            }
            100% {
                opacity: 1;
            }
        }
        .login-button { /* 按钮美化 */
            width: 270px; /* 宽度 */
            height: 40px; /* 高度 */
            border-width: 0px; /* 边框宽度 */
            border-radius: 3px; /* 边框半径 */
            background: #1E90FF; /* 背景颜色 */
            cursor: pointer; /* 鼠标移入按钮范围时出现手势 */
            outline: none; /* 不显示轮廓线 */
            font-family: Microsoft YaHei; /* 设置字体 */
            color: white; /* 字体颜色 */
            font-size: 17px; /* 字体大小 */
        }
        .login-button:hover { /* 鼠标移入按钮范围时改变颜色 */
            background: #5599FF;
        }
    </style>
</head>
<body>
<div class="conic" style="display:block">
    <form action="../edit-servlet" method="POST" enctype="multipart/form-data" ><!--用此框架上传无法用request获取*/-->
        <table style='background-color:#000000;padding:2em'>
            <tr><td style="color: cornflowerblue">项目名:</td><td><input type='text' name="title" value='<%=title%>' style="background-color: black;height: 40px;color:#5599FF "></td></tr>
            <tr style="height: 50px"><td style="color: cornflowerblue">图片: </td><td><input type='file' name="picpath"></td></tr>
            <tr><td style="color: cornflowerblue">描述: </td><td><textarea name="content" cols="50" rows="5" style="background-color: black;color:#5599FF" ><%=content%></textarea></td></tr>
            <input type="hidden" name="id" value="<%=id%>">
            <tr><td></td></tr>
            <tr><td colspan="2" style="color: cornflowerblue"><input class="login-button" type='submit' value="确定修改" style="display:block;margin:0 auto"> </td></tr>
        </table>
    </form>
</div>
</body>
</html>
